package com.java01;

import java.util.Scanner;

public class eighthjava {
    public static void main(String[] args) {
        int i,j,count = 0;
        double sum,allsum = 0;
        Scanner scanner = new Scanner(System.in);
        for(i=1;i<=3;i++){
            sum = 0;
            for (j=1;j<=5;j++){
                System.out.println("请输入"+ i + "班第"+ j +"个学生成绩：");
                double score = scanner.nextDouble();
                sum += score;
                if (score>=60){
                    System.out.println("成绩及格！");
                }else{
                    System.out.println("成绩不及格！");
                    count++;
                }
            }
            System.out.println(i+"班成绩平均分为"+(sum/5));
            allsum+=sum;
        }
        System.out.println("三个班总成绩是"+allsum+"平均分为"+(allsum/15));
        System.out.println("不及格人数有"+count+"人");
    }
}

class for01{
    public static void main(String[] args) {
        int i,j,k,hs=5;
        for (i=1;i<=hs;i++){
            for (k=1;k<=hs-i;k++){
                System.out.print(" ");
            }
            for (j=1;j<=2*i-1;j++){
                if (j==1||j==2*i-1) {
                    System.out.print("*");
                }else {
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
        for (i=hs;i>=1;i--){
            for (k=1;k<=hs-i;k++){
                System.out.print(" ");
            }
            for (j=1;j<=2*i-1;j++){
                if (j==1||j==2*i-1) {
                    System.out.print("*");
                }else {
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }
}
